
    var roothot="https://liu.hunliv.com/";
  //获取登录信息
  var getLogin= function(){

  return new Promise(function (resolve, reject) { 
   // if(that.data.token==''){
        wx.request({
        url: roothot+"auth/login",
        method: "post",
        data: {
          'rememberMe':'',
          'username':'admin',
          'password':'IP+vxrHpRPXS7CcRLrvSg+q5ISaSOv4hodlM1CzIPC4nz/kIVmakLO6V5f9vB4i/kyHZVZkN5fNjOsFiFq//8w==',
          'code':'weixin'
        },
        success: (res) => {
          resolve(res)
        },
        fail:(res) =>{
          reject(res)
        }
     });
   // }

  });
 
}

//获取个人信息
  var getBase= function(token){
  return new Promise(function (resolve, reject) { 
   // if(that.data.token!=''){
      wx.request({
        url: roothot+"api/weixin/getBase",
        method: "post",
        data: {
        },
        header: {
          Authorization:token
        },
        success: (res) => {
          resolve(res)
        },
        fail:(res) =>{
          reject(res)
        }
    });
//}
  })
}
//获取类型信息
var getWeddingTypes= function(token){
  return new Promise(function (resolve, reject) { 
   // if(that.data.token!=''){
      wx.request({
        url:roothot+ "api/weixin/getWeddingTypes",
        method: "post",
        data: {
        },
        header: {
          Authorization:token
        },
        success: (res) => {
          resolve(res)
        },
        fail:(res) =>{
          reject(res)
        }
    });
//}
  })
}
//获取数据信息
var getWeddings= function(token, params){
  return new Promise(function (resolve, reject) { 
   // if(that.data.token!=''){
   var data = JSON.stringify(params);
   
      wx.request({
        url: roothot+"api/weixin/getWeddings",
        method: "post",
        data: data,
        header: {
          'content-type': 'application/json',
          Authorization:token
        },
        success: (res) => {
          resolve(res)
        },
        fail:(res) =>{
          reject(res)
        }
    });
//}
  })
}
//获取人员信息
var getPersion= function(token){
  return new Promise(function (resolve, reject) { 
   // if(that.data.token!=''){
      wx.request({
        url: roothot+"api/weixin/getPersion",
        method: "post",
        data: {
        },
        header: {
          Authorization:token
        },
        success: (res) => {
          resolve(res)
        },
        fail:(res) =>{
          reject(res)
        }
    });
//}
  })
}
module.exports={
  getLogin:getLogin,
  getBase:getBase,
  getWeddingTypes:getWeddingTypes,
  getWeddings:getWeddings,
  getPersion:getPersion
}